home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 317 / asmsrc / hash.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-20  |  2.3 KB  |  63 lines

  1. /* hash.h - for hash.c */
  2.  
  3. /* Copyright (C) 1987 Free Software Foundation, Inc.
  4.  
  5. This file is part of Gas, the GNU Assembler.
  6.  
  7. The GNU assembler is distributed in the hope that it will be
  8. useful, but WITHOUT ANY WARRANTY.  No author or distributor
  9. accepts responsibility to anyone for the consequences of using it
  10. or for whether it serves any particular purpose or works at all,
  11. unless he says so in writing.  Refer to the GNU Assembler General
  12. Public License for full details.
  13.  
  14. Everyone is granted permission to copy, modify and redistribute
  15. the GNU Assembler, but only under the conditions described in the
  16. GNU Assembler General Public License.  A copy of this license is
  17. supposed to have been given to you along with the GNU Assembler
  18. so you can know your rights and responsibilities.  It should be
  19. in a file named COPYING.  Among other things, the copyright
  20. notice and this notice must be preserved on all copies.  */
  21.  
  22. #ifndef hashH
  23. #define hashH
  24.  
  25. struct hash_entry
  26. {
  27.   char *      hash_string;    /* points to where the symbol string is */
  28.                 /* NULL means slot is not used */
  29.                 /* DELETED means slot was deleted */
  30.   char *      hash_value;    /* user's datum, associated with symbol */
  31. };
  32.  
  33.  
  34. #define HASH_STATLENGTH    (6)
  35. struct hash_control
  36. {
  37.   struct hash_entry * hash_where; /* address of hash table */
  38.   int         hash_sizelog;    /* Log of ( hash_mask + 1 ) */
  39.   int         hash_mask;    /* masks a hash into index into table */
  40.   int         hash_full;    /* when hash_stat[STAT_USED] exceeds this, */
  41.                 /* grow table */
  42.   struct hash_entry * hash_wall; /* point just after last (usable) entry */
  43.                 /* here we have some statistics */
  44.   int hash_stat[HASH_STATLENGTH]; /* lies & statistics */
  45.                 /* we need STAT_USED & STAT_SIZE */
  46. };
  47.  
  48.  
  49. /*                        returns          */
  50. struct hash_control *    hash_new();    /* [control block]      */
  51. void            hash_die();
  52. void            hash_say();
  53. char *            hash_delete();    /* previous value         */
  54. char *            hash_relpace();    /* previous value         */
  55. char *            hash_insert();    /* error string           */
  56. char *            hash_apply();    /* 0 means OK             */
  57. char *            hash_find();    /* value                  */
  58. char *            hash_jam();    /* error text (internal)  */
  59. char *            hash_grow();    /* error text (internal)  */
  60. #endif                /* #ifdef hashH */
  61.  
  62. /* end: hash.c */
  63.